<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script>
	function addDemo(){
		var data = {
				name:$("input[name='name']").val()
		};
		$.ajax({
		  type: "POST",
		  url: "localhost:8082/demo/add",
		  data: data,
		  success: function(result){
			  alert(JSON.stringify(result));
		  },
		  dataType: 'json'
		});
	};
</script>
</head>
<body>
	<div style="margin: 0 auto;top:100px;width: 500px;text-align: center;">
		<table>
			<thead><tr><td colspan="2">hello Spring boot</td></tr></thead>
			<tr><td width="20%">名称：</td><td><input type="text" name = "name" /></td></tr>
			<tr><td width="20%">描述：</td><td><textarea name="description" rows="5" cols="22"></textarea></td></tr>
			<tr><td colspan="2"><input type="button" value="确认" onclick="javascript:addDemo();"/></td></tr>
		</table>
	</div>
</body>
</html>